package spring.cloud.eams.controller;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author : fengkun
 * @date : 2020/5/6
 */
@RestController
@RequestMapping("/student")
public class StudentController {

  public static final String URL = "http://localhost:9001";

  private RestTemplate restTemplate = new RestTemplate();

  @RequestMapping("/list/{name}")
  public String index(@PathVariable("name") String name) {
    return restTemplate.getForObject(URL + "/server/student/list/" + name, String.class);
  }
}
